/**
 * @fileOverview
 * WashizuMahjong.
 * http://code.google.com/p/washizu-mahjong/
 */
/**
 * @class
 * @public
 * @this {Meld}
 * @param {String}	type	Meld type. e.g. "KONG", "CHOW"
 * @param {Mahjong}
 */
function Meld(type, taked_tile, meld_tiles){
	if(!(this instanceof Meld))
		return new Meld(type, taked_tile, meld_tiles);
	this.type = type;
	this.takedTile = taked_tile;
	this.meldTiles = meld_tiles;
}
Meld.prototype.__defineGetter__("tiles", function(){
	var tiles = this.meldTiles.clone() || [];
	tiles.push(this.takedTile);
	if(this.kongType == KongType.Added_Open_Quad){
		tiles.push(this.addKongTile);
	}

	Hand.sort(tiles);
	return tiles;
});
/**
 * The type of the meld
 * @type String
 * @see MeldType
 */
Meld.prototype.type = null;
/**
 * The type of the meld
 * @type MahjongTile
 * @see MeldType
 */
Meld.prototype.takedTile = null;
/**
 * If the meld is a Kong, it will give the detail of the type of the kong.
 * @default KongType.None
 * @type Number
 * @see KongType
 */
Meld.prototype.kongType = KongType.None;
/**
 * If the meld is Added open quad, it is the added tile.
 * @default null
 * @type MahjongTile
 */
Meld.prototype.addKongTile = null;
